package com.jgybzx.controller;

import com.alibaba.fastjson.JSON;
import com.jgybzx.entity.User;
import com.jgybzx.mapper.UserMapper;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Jgybzx
 * @date 2021/8/17 17:41
 * des
 */
@RestController
@RequestMapping("test")
public class TestController {
    private final UserMapper userMapper;

    public TestController(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @PostMapping("/test")
    public String test() {
        User user = userMapper.queryUserAndRoleAndPermission(1);
        return JSON.toJSONString(user);
    }
}
